<template>
  <div class="dynamic">
    <div class="dynamictop">
      <div>
        <van-icon name="friends-o" size="70" />
        <p>添加更多好友</p>
      </div>
      <div v-for="(item, index) in list" :key="index">
        <img :src="item.avatarUrl" alt="" />
        <p>{{ item.nickname }}</p>
      </div>
    </div>
    <div class="dynamicmain">
      <b>我的关注</b>
      <van-tabs v-model="active" class="dynamictab">
        <van-tab title="全部" :to="{ name: 'All' }"></van-tab>
        <van-tab title="音乐人" :to="{ name: 'Musician' }"></van-tab>
        <van-tab title="朋友" :to="{ name: 'Friend' }"></van-tab>
      </van-tabs>
    </div>
    <router-view></router-view>
  </div>
</template>

<script>
import axios from "axios";
export default {
  data() {
    return {
      active: 0,
      list: [],
    };
  },
  computed: {},
  watch: {},

  methods: {
    userList() {
      axios
        .get("http://localhost:3000/user/follows?uid=307789764")
        .then((res) => {
          this.list = res.data.follow;
        });
    },
  },
  created() {
    this.userList();
    this.$router.push("/follow/dynamic/all");
  },
  mounted() {},
  components: {},
};
</script>
<style scoped>
* {
  margin: 0;
  padding: 0;
}
.dynamictop {
  margin-top: 20px;
  display: flex;
}
.dynamictop > div {
  margin-right: 20px;
}
p {
  text-align: center;
  font-size: 12px;
}
img {
  border-radius: 35px;
  display: inline-block;
  width: 70px;
  height: 70px;
}

.dynamicmain {
  display: flex;
  justify-content: space-between;
  height: 50px;
  line-height: 50px;
}
.dynamictab {
  width: 200px;
}
</style>
